package com.CampaignManager.server;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class PlayerCity {
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key id;
	public Key getId() {
		return this.id;
	}
	
	@Persistent
	private Player player;	
	public Player getPlayer() {
		return this.player;
	}
	
	@Persistent
	private String email;
	@Persistent
	private String city;
	@Persistent
	private Long favor;
	@Persistent
	private Long leverage;
	
	public String getEmail() {
		if (email == null) email = player.getEmail();
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getCity() {
		return city;
	}
	public void setCity(String city) {
		this.city = city;
	}
	public Long getFavor() {
		return favor;
	}
	public void setFavor(Long favor) {
		this.favor = favor;
	}
	public Long getLeverage() {
		return leverage;
	}
	public void setLeverage(Long leverage) {
		this.leverage = leverage;
	}
}
